package com.zohnblog.dao;


import com.zohnblog.model.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    // 分页展示所有用户
    @Select("SELECT u.id, u.username, u.email, u.created, u.valid, ua.authority_id FROM t_user u INNER JOIN t_user_authority ua ON u.id = ua.user_id AND ua.authority_id = 2 ORDER BY u.id DESC")
    public List<User> selectAllUser();
}
